using System;
using System.Collections.Generic;
using System.Text;

namespace ControlPoint.ControlAPI
{
	public class Item
	{
		protected string _id;
		protected string _name;
        protected SettingsList _settings;

        public Item() {
            if (this._settings == null) {
                this._settings = new SettingsList();
            }
        }

		public Item(SettingsList settings) {
            this._settings = settings;
            if (this._settings.ContainsSetting("name")) {
                this._name = (string)this._settings.GetSetting("name").Value;
            }
		}

        public string Name {
            get {
                if (this._settings.ContainsSetting("name")) {
                    return (string)this._settings.GetSetting("name").Value;
                } else {
                    return String.Empty;
                }
            }
            set {
                this._settings.SetSetting("name", value);
            }
        }

		public string ID
		{
			get
			{
                return this._id;
			}
		}

		public virtual SettingsList Settings
		{
			get
			{
                return this._settings;
			}
		}
	}
}
